<?php

namespace Modules\View;
use Src\View;

class TestView extends View
{
    public  $objectName;

    public function __construct()
    {
        parent::__construct();
        $this->objectName = str_replace('view', '', strtolower(basename(str_replace('\\', '/', __CLASS__))));
    }

    //用smarty返回
    public function test3($modal_show = 'hide', $modal_message = '', $modal_url = '')
    {
        if ($modal_show == 'show') {
            $this->modalSet($modal_show, $modal_message, $modal_url);
            return $this->smarty->smarty->fetch($this->objectName.DIRECTORY_SEPARATOR.__FUNCTION__.".html");
        } else {
            return $this->smarty->smarty->fetch($this->objectName.DIRECTORY_SEPARATOR.__FUNCTION__.".html");
        }
    }

    //接口返回,调用本类的response对象输出json，$args0,$args1,$args2,分别为code，message，result,
    public function __call($method, $args)
    {
        return $this->response->json1($args[0], $args[1], $args[2]);
    }

}